\usepackage{tikz}

\newcommand{\actors}{\mathcal{A}}
\newcommand{\empt}{\epsilon}

\newcommand{\ctxm}[3]{
   \ifthenelse{\equal{#2}{}}{{#1}|{\raisebox{-2pt}{$\scriptstyle#3$}}}{{#1}|^{#2}_{#3}}
    }
\newcommand{\ctxmp}[3]{{#1}|^{#2}_{#3}}   % needed because ctxm gives error when used in captions
\newcommand{\ctx}[2]{*|^{#1}_{#2}}


\newcommand{\kcerel}{\doteq_0}
\newcommand{\nkcerel}{\not\kcerel}
\newcommand{\ktcerel}{\doteq}
\newcommand{\nktcerel}{\not\ktcerel}
\newcommand{\dequatable}[3]{{#1}\semivdash{#2}\kcerel{#3}}
\newcommand{\equatable}[3]{{#1}\semivdash{#2}\ktcerel{#3}}
\newcommand{\nequatable}[3]{{#1}\not\semivdash{#2}\ktcerel{#3}}



\newcommand{\construct}[2]{#1{\leftarrow}{#2}}
\newcommand{\eliminate}[3]{#1\underrightarrow{\vspace{-0.45em}^{~#2~}}#3}
\newcommand{\contents}[1]{{\doteq}#1}


\newcommand{\semivdash}{\mathbin{\tikz [baseline=-0.25ex, dashed,dotted] \draw [solid] (0em,-0.3ex) -- (0em,1.3ex); \tikz [baseline=-0.25ex, dashed,dotted] \draw [densely dotted] (0em,0.5ex) -- (0.5em,0.5ex);}}
\newcommand{\semicvdash}{\semivdash^+}
\newcommand{\semidvdash}{\semivdash^-}


\newcommand{\related}{\Leftrightarrow}
\newcommand{\linkable}{\leftrightarrow}
\newcommand{\linkableby}[1]{\leftrightarrow_{#1}}

\newcommand{\imodel}{(\mathsf{P}^{ctx},\mathcal{P}^{inf},\mathbb{P}^{cnt},\related,\sigma,\tau)}
\newcommand{\pimodel}{(\mathsf{O}^{ctx},\mathcal{O}^{inf},\mathbb{O}^{cnt},\related,\sigma,\tau)}
\newcommand{\pimodelres}{(\mathsf{O}^{ctx},\mathcal{O}^{inf},\mathbb{O}^{cnt},\related,\sigma|_{\ctxpi},\tau|_{\infpi})}
\newcommand{\view}[1]{(\mathsf{O}_{#1},\leftrightarrow_{#1})}

\newcommand{\ctxitems}{\mathsf{P}^{ctx}}
\newcommand{\ctxpi}{\mathsf{O}^{ctx}}
\newcommand{\ctxid}{\mathsf{I}^{ctx}}
\newcommand{\ctxdi}{\mathsf{D}^{ctx}}
\newcommand{\ctxnp}{\mathsf{G}^{ctx}}
\newcommand{\infitems}{\mathcal{P}^{inf}}
\newcommand{\infpi}{\mathcal{O}^{inf}}
\newcommand{\infid}{\mathcal{I}^{inf}}
\newcommand{\infdi}{\mathcal{D}^{inf}}
\newcommand{\infnp}{\mathcal{G}^{inf}}
\newcommand{\cntitems}{\mathbb{P}^{cnt}}
\newcommand{\cntpi}{\mathbb{O}^{cnt}}


% ----- multiple data subjects extension --------------------------------------

\newcommand{\imodelmd}{(\mathsf{P}^{ctx},\mathcal{P}^{inf},\mathbb{P}^{cnt},\related,\sigma,\tau)}
\newcommand{\pimodelmd}{(\mathsf{O}^{ctx},\mathcal{O}^{inf},\mathbb{O}^{cnt},\related,\sigma,\tau)}
\newcommand{\ctxil}{\mathsf{I}_l^{ctx}}
\newcommand{\ctxig}{\mathsf{I}_g^{ctx}}
\newcommand{\infil}{\mathcal{I}_l^{inf}}
\newcommand{\infig}{\mathcal{I}_g^{inf}}
\newcommand{\typeof}[1]{\textrm{t}(#1)}


% ----- notation for coalition graphs -----------------------------------------

\newcommand{\coaknow}{\ensuremath{\vDash}}


% ----- notation for symbolic model -------------------------------------------

\newcommand{\symitems}{\mathfrak{P}^{sym}}
\newcommand{\symnp}{\mathfrak{G}^{sym}}
\newcommand{\symdi}{\mathfrak{D}^{sym}}
\newcommand{\symid}{\mathfrak{I}^{sym}}



\newcommand{\ico}[2]{#1 {\doteq} #2}
\newcommand{\eco}[2]{({#1})_l {\doteq} ({#2})_r}
\newcommand{\constraint}{\gamma}
\newcommand{\true}{\textbf{T}}
\newcommand{\false}{\textbf{F}}

\newcommand{\symdert}[2]{{#1}{\Rightarrow}{#2}}

%\newcommand{\Symder}{\semivdash}
%\newcommand{\symder}[3]{{#1}\semivdash{#2}{\Rightarrow}{#3}}
\newcommand{\Symderm}{\semivdash^s}
\newcommand{\Symderc}{\semivdash^c}
\newcommand{\Symdermp}{\semivdash^{s*}}
\newcommand{\Symdercp}{\semivdash^{c*}}
\newcommand{\symderm}[3]{{#1}\semivdash^s{#2}{\Rightarrow}{#3}}
\newcommand{\symderc}[3]{{#1}\semivdash^c{#2}{\Rightarrow}{#3}}
\newcommand{\symdermp}[3]{{#1}\semivdash^{s*}{#2}{\Rightarrow}{#3}}
\newcommand{\symdercp}[3]{{#1}\semivdash^{c*}{#2}{\Rightarrow}{#3}}


\newcommand{\instrandom}[1]{\overline{\mathbf{#1}}}

\newcommand{\dcl}[1]{({#1})_l}
\newcommand{\dcr}[1]{({#1})_r}

\def\symp#1{#1}
\def\sympr#1#2{#1(#2)}
\def\sympro#1#2#3{\ctxm{#1(#2)}{}{#3}}

\newcommand{\bbox}[1]{\colorbox{black}{\color{white}#1}}
\newcommand{\symcebox}[1]{\fbox{#1}}

% variable-length lists
\newcommand{\symitem}[3]{#1@_{#2}{#3}} % variable name inside ctx item
\newcommand{\symsumat}[3]{#1@_{#2}{#3}} % message 
\newcommand{\symsum}[2]{\{#1\}_{#2}}

% ----- notation for parelsnoer analysis --------------------------------------

\def\freq#1{\textbf{(FR{#1})}}
\def\dd#1{\textbf{(DD{#1})}}

% ----- notation for chstatic -------------------------------------------------

\newcommand{\sigeq}{{\Sigma^{eq}}}
\newcommand{\kbeq}{{\mathcal{C}^{eq}}}
\newcommand{\kbeqaug}[1]{{\mathcal{C}^{eq+{#1}}}}

\newcommand{\traceeq}[2]{{#1}\approx_t{#2}}

\newcommand{\recipes}{\mathcal{T}_{\mathcal{X}\cup\mathcal{N}}}
\newcommand{\groundterms}{\mathcal{T}_{\mathcal{N}}}
\newcommand{\varterms}{\mathcal{T}_{\mathcal{X}}}
\newcommand{\ctxterms}{\mathcal{T}_{\ctxitems}}
\newcommand{\cntterms}{\mathcal{T}_{\cntitems}}


\newcommand{\dequatableq}[3]{{#1}\vdash{#2}\kcerel{#3}}
\newcommand{\equatableq}[3]{{#1}\vdash{#2}\ktcerel{#3}}
\newcommand{\nequatableq}[3]{{#1}\not\vdash{#2}\ktcerel{#3}}


% ----- notation for attribute predicates -------------------------------------

\newcommand{\attpredinf}[2]{{#1}?_{#2}}
\newcommand{\attpredctx}[4]{\ctxm{{#1}?_{#4}}{#2}{#3}}
\newcommand{\pimodelap}{(\mathsf{O}^{ctx},\mathcal{O}^{inf},\mathbb{O}^{cnt},\related,\sigma,\tau)}
\newcommand{\ctxpr}{\mathsf{R}^{ctx}}
\newcommand{\infpr}{\mathcal{R}^{inf}}


% ----- notation for traces ---------------------------------------------------

\newcommand{\trans}[5]{{#1}({#2})\to{#3}({#4})~:~{#5}}
\newcommand{\transalign}[5]{{#1}({#2})\to{#3}({#4})~:~&{#5}}
\newcommand{\transalignn}[3]{{#1}\to{#2}~:~&{#3}}


\newcommand{\atsign}{\ensuremath{@}}
\newcommand{\nbar}{|}
